import request from '@/utils/request'
import { getToken } from '@/utils/auth'

export function login(data) {
  //网上
  //POST /admin/acl/index/login
  //自己
  //POST /service_manage/admin/adminLogin
  return request({
    //后台权限的登录地址
    // url: '/admin/acl/index/login',
    url: '/service_manage/admin/adminLogin',
    method: 'post',
    
    data:data
  })
}

export function getInfo(token) {
   //GET /admin/acl/index/info
  // GET /service_manage/admin/getAdminInfo/{token}
  //GET /service_manage/admin/getUserInfo
  //七天无密码登录
  return request({
    //  url: '/admin/acl/index/info',
    
    url: '/service_manage/admin/getAdminInfo1',
    method: 'get',
    //此处的params其实是用来接收query传参用的会自动将对象的属性名作为key，属性值为value
    params: { token:token }
  })
}

export function logout(token) {
  //POST /admin/acl/index/logout
  //DELETE /service_manage/admin/deleteAdmin1
  //DELETE /service_manage/admin/deleteAdmin1
  //GET /service_manage/admin/getAdminInfo1
  return request({
    params:{token:token},
    
    url: '/service_manage/admin/getAdminInfo1',
    // method:'post'
    // url:'/service_manage/admin/deleteAdmin1',
    method: 'get',
    // params:{token:getToken()}
  })
}
